<!DOCTYPE html>
<html>
<head>
    <title>报价属性--材料</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline" role="form">
                <div class="form-group">
                    <a @click="reset">
                        <i class="fa fa-refresh"></i>
                    </a>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.attributeName" @keyup.enter="query" placeholder="属性名称">
                </div>&nbsp;&nbsp;&nbsp;
                <a class="btn btn-primary btn-sm " @click="query">
                    <i class="fa fa-search"></i>&nbsp;查询</a>
            <#if shiro.hasPermission("quoteAttribute:quoteattribute:save")>
            <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
        </#if>
        <#if shiro.hasPermission("quoteAttribute:quoteattribute:update")>
        <a class="btn btn-primary btn-sm" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
    </#if>
    <#if shiro.hasPermission("quoteAttribute:quoteattribute:delete")>
    <a class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</#if>
    </form>
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>

<div v-show="showList1" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">属性名称</div>
            <div class="col-sm-10">
                <select v-model="quoteAttribute.attributeTypeValue" class="form-control input-sm">
                <option v-for="item in quoteAttributeValueEnum" :value="item.value">{{item.describe}}</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">商品分类</div>
            <div class="col-sm-10">
                <el-cascader style="width: 100%"  :options="categoryTree" @change="categoryChange"></el-cascader>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">属性排序</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttribute.attributeSort" placeholder="仅限数字"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">前端显示</div>
            <div class="col-sm-10">
                <select v-model="quoteAttribute.display" class="form-control input-sm">
                    <option value="true">显示</option>
                    <option value="false">不显示</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">单位</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttribute.attributeUnit" placeholder="单位"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">折叠分类</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttribute.attributeFoldIndex" placeholder="仅限数字"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">是否自定义</div>
            <div class="col-sm-10">
                <select v-model="quoteAttribute.attributeCanDefinition" class="form-control input-sm">
                    <option value=false>否</option>
                    <option value=true>是</option>
                </select>
            </div>
        </div>
        <div class="form-group" v-show="quoteAttribute.attributeCanDefinition=='true'||quoteAttribute.attributeCanDefinition==true">
            <div class="col-sm-2 control-label">自定义参数</div>
            <div class="col-sm-10">
                <div v-for="(item,index) of list">
                    <input type="number" placeholder="最小值" v-model="item[0]"> ~ <input type="number" v-model="item[1]" placeholder="最大值">
                    <input type="button" @click="addOpt" value="+"><input type="button" @click="delOpt(index)" value="-">
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary  btn-sm" @click="saveOrUpdate" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
        </div>
    </form>
</div>

<!--添加选项start-->
<div v-show="addOption" class="panel panel-default">
    <div class="panel-heading">添加选项</div>
    <form class="form-horizontal">
        <input type="hidden" v-model="quoteAttributeOption.optionAttributeId">
        <div class="form-group">
            <div class="col-sm-2 control-label">选项名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="optionName" placeholder="选项名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">是否特种纸</div>
            <div class="col-sm-10">
                <select v-model="quoteAttributeOption.optionValue" class="form-control input-sm">
                    <option value=0>否</option>
                    <option value=1>是</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">选项key</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionKey" placeholder="选项key"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">前端显示</div>
            <div class="col-sm-10">
                <select v-model="quoteAttributeOption.display" class="form-control input-sm">
                    <option value="true">显示</option>
                    <option value="false">不显示</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">排序</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttributeOption.optionSort" placeholder="排序"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">单位</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionUnit" placeholder="单位"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">是否自翻</div>
            <div class="col-sm-10">
                <select v-model="quoteAttributeOption.reprints" class="form-control input-sm">
                    <option value=false>否</option>
                    <option value=true>是</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">是否自定义</div>
            <div class="col-sm-10">
                <select v-model="quoteAttributeOption.optionCanDefinition" class="form-control input-sm">
                    <option value="false">否</option>
                    <option value="true">是</option>
                </select>
            </div>
        </div>
        <div class="form-group" v-show="quoteAttributeOption.optionCanDefinition=='true'">
            <div class="col-sm-2 control-label">自定义参数</div>
            <div class="col-sm-10">
                <div v-for="(item,index) of list">
                    <input type="number" placeholder="最小值" v-model="item[0]"> ~ <input type="number" v-model="item[1]" placeholder="最大值">
                    <input type="button" @click="addOpt" value="+"><input type="button" @click="delOpt(index)" value="-">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">添加克重</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttributeOption.optionName2" placeholder="克重"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">添加厚度</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttributeOption.optionName3" placeholder="厚度"/>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary  btn-sm" @click="addQuoteAttributeOption" value="添加"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
        </div>
    </form>
</div>
<!--添加选项end-->
<!--查看详情start-->
<div v-show="gridDetail">
<div class="row-fluid">
    <div class="grid-btn">
        <form class="form-inline" role="form">
            <div class="form-group">
                <a @click="resetDet">
                    <i class="fa fa-refresh"></i>
                </a>
            </div>&nbsp;&nbsp;&nbsp;

            <div class="form-group">
                <input type="text" class="form-control input-sm" v-model="q.optionName" placeholder="选项名称">
            </div>&nbsp;&nbsp;&nbsp;
            <a class="btn btn-primary btn-sm " @click="queryDet">
                <i class="fa fa-search"></i>&nbsp;查询</a>
    <a class="btn btn-primary btn-sm" @click="updateDet"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
    <a class="btn btn-primary btn-sm" @click="delDet"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
        </form>
</div>
    <div class="span12">
        <table id="jqGridDetail"></table>
        <div id="jqGridPagerDetail"></div>
    </div>
</div>
    <div class="form-group">
        <div class="col-sm-6 control-label"></div>
        <input type="button" class="btn btn-primary  btn-sm" @click="reload" value="确定"/>
        &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
    </div>
</div>
<!--查看详情end-->
<!--编辑子选项start-->
<div v-show="editDet" class="panel panel-default">
    <div class="panel-heading">编辑</div>
    <form class="form-horizontal">
        <input type="hidden" v-model="quoteAttributeOption.optionAttributeId">
        <div class="form-group">
            <div class="col-sm-2 control-label">选项名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionName" placeholder="选项名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">选项值key</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionKey" placeholder="选项值key"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">选项value</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionValue" placeholder="选项value"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">前端显示</div>
            <div class="col-sm-10">
                <select v-model="quoteAttributeOption.display" class="form-control input-sm">
                    <option value="true">显示</option>
                    <option value="false">不显示</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">单位</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionUnit" placeholder="单位"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">排序</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionSort" placeholder="选项排序"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">是否自定义</div>
            <div class="col-sm-10">
                <select v-model="quoteAttributeOption.optionCanDefinition" class="form-control input-sm">
                    <option value="false">否</option>
                    <option value="true">是</option>
                </select>
            </div>
        </div>
        <div class="form-group" v-show="quoteAttributeOption.optionCanDefinition=='true'||quoteAttributeOption.optionCanDefinition==true">
            <div class="col-sm-2 control-label">自定义参数</div>
            <div class="col-sm-10">
                <div v-for="(item,index) of list">
                    <input type="number" placeholder="最小值" v-model="item[0]"> ~ <input type="number" v-model="item[1]" placeholder="最大值">
                    <input type="button" @click="addOpt" value="+"><input type="button" @click="delOpt(index)" value="-">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">添加克重</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttributeOption.optionName2" placeholder="克重"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">添加厚度</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model="quoteAttributeOption.optionName3" placeholder="厚度"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary  btn-sm" @click="updateDel" value="保存"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
        </div>
    </form>
</div>
<!--编辑子选项end-->
</div>

<script src="${request.contextPath}/statics/js/modules/quoteAttribute/quoteattributeMaterial.js?_${.now?long}"></script>
</body>
</html>